const {jwtDecode} = require("../utils");
module.exports = {
	author(){
		return async (req,res,next)=>{
			try{
				const token = req.get("token");// 获取请求头
				req.adminInfo = await jwtDecode(token);
				next();
			}catch (err){
				res.json({
					ok:-2,
					msg:"token异常"
				})
			}
		}
	}
}